#ifndef __CONFIGURATION_H__
#define __CONFIGURATION_H__

#include "../include/NonCopyable.h"
#include <map>
#include <string>

using std::map;
using std::string;

namespace myNameSpace {
class Configuration: NonCopyable {
public:
    static Configuration *getInstance();
    void read(const string &filename = "./conf/server.conf");
    string getValue(const string &key);

private:
    Configuration();
    ~Configuration();

    static void init();
    static void destroy();

private:
    map<string, string> _map;
    static Configuration *_pInstance;
    static pthread_once_t _once;
};
} // end of namespace myNameSpace
#endif
